/*
 * CharacterFormat.java  0.4.0 / Oct 25, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
package com.cute4j.swing.text;

import com.cute4j.swing.Swing;
import com.cute4j.swing.graphics.Color;
import com.cute4j.swing.graphics.Font;

/**
 * Character Format.
 *
 * @cute4j.native
 *    generate="jni"
 *    includes="QTextCharFormatAdapter.h"
 *
 * @author Slobodan Vrkacevic
 * @version 0.4.0
 */
public class CharacterFormat {

// Static Initialization. ------------------------------------------------------

  static {
    Swing.initialize();
    _initialize();
  }

// Package-Private Fields. -----------------------------------------------------

  Font font;
  boolean fontBold;
  Color color;

  // TODO: add other fields

// Public Constructors. --------------------------------------------------------

  /**
   * Constructs new CharacterFormat object.
   */
  public CharacterFormat() {
    // empty constructor body
  }

  /**
   * Constructs new CharacterFormat object.
   *
   * @param font the font
   */
  public CharacterFormat(Font font) {
    this.font = font;
  }

  /**
   * Constructs new CharacterFormat object.
   *
   * @param color the color
   */
  public CharacterFormat(Color color) {
    this.color = color;
  }

// Public Methods. -------------------------------------------------------------

  /**
   * Returns font.
   *
   * @return font.
   */
  public Font getFont() {
    return font;
  }

  /**
   * Sets font.
   *
   * @param font the font
   */
  public void setFont(Font font) {
    this.font = font;
  }

  /**
   * Returns <tt>true</tt> if the font is bold.
   *
   * @return <tt>true</tt> if the font is bold
   */
  public boolean isFontBold() {
    return fontBold;
  }

  /**
   * Sets whether or not the font is bold.
   *
   * @param fontBold <tt>true</tt> if bold
   */
  public void setFontBold(boolean fontBold) {
    this.fontBold = fontBold;
  }

  /**
   * Returns color.
   *
   * @return color
   */
  public Color getColor() {
    return color;
  }

  /**
   * Sets color.
   *
   * @param color the color
   */
  public void setColor(Color color) {
    this.color = color;
  }

  // TODO: add other getter and setter

// Private Static Native Method. -----------------------------------------------

  /**
   * @cute4j.native
   *    code="QTextCharFormatAdapter::initialize(env, cls);"
   */
  private static native void _initialize();

}
